package com.example.demonstrate.wang.test;

/**
 * @Author along
 * @Date 2024/6/7 13:02
 * @Description leetcode 3038.相同分数的最大操作数目
 */
public class Solution {
    public int maxOperations(int[] nums) {
        int n = nums.length;
        int count = 0;
        for (int i =  1;  i < n; i += 2) {
            if (nums[i] + nums[i - 1] != nums[1] + nums[0]) {
                break;
            }
            count++;
        }
        return count;
    }

    public static void main(String[] args) {
        int[] nums = {3, 2, 1, 4, 5};
        Solution solution = new Solution();
        System.out.println(solution.maxOperations(nums));
    }
}
